<?php
/**
 * Created by PhpStorm.
 * User: yuanjie
 * Date: 16/7/28
 * Time: 下午7:50
 */
$api_service_path = __DIR__ . "/../../../api/";
ob_start();
require_once($api_service_path . "public/index.php");
ob_end_clean();
DB::connection()->disableQueryLog(); 
if(file_exists('/data/anhui/api/app/scripts/report_task.pid')){
    exit;
}else{
    touch('/data/anhui/api/app/scripts/report_task.pid');
    echo date('Y-m-d H:i:s',time())." start \n";
    ReportTask::exec();
    echo date('Y-m-d H:i:s',time())." stop \n";
    unlink('/data/anhui/api/app/scripts/report_task.pid');
}
